import 'package:hotpot/generated/json/base/json_convert_content.dart';
import 'package:hotpot/models/loyalty_card.dart';

LoyaltyCard $LoyaltyCardFromJson(Map<String, dynamic> json) {
	final LoyaltyCard loyaltyCard = LoyaltyCard();
	final double? points = jsonConvert.convert<double>(json['points']);
	if (points != null) {
		loyaltyCard.points = points;
	}
	final String? pointName = jsonConvert.convert<String>(json['point_name']);
	if (pointName != null) {
		loyaltyCard.pointName = pointName;
	}
	final String? pointsDisplay = jsonConvert.convert<String>(json['points_display']);
	if (pointsDisplay != null) {
		loyaltyCard.pointsDisplay = pointsDisplay;
	}
	final String? programType = jsonConvert.convert<String>(json['program_type']);
	if (programType != null) {
		loyaltyCard.programType = programType;
	}
	final List<String>? partnerId = jsonConvert.convertListNotNull<String>(json['partner_id']);
	if (partnerId != null) {
		loyaltyCard.partnerId = partnerId;
	}
	final String? expirationDate = jsonConvert.convert<String>(json['expiration_date']);
	if (expirationDate != null) {
		loyaltyCard.expirationDate = expirationDate;
	}
	final String? code = jsonConvert.convert<String>(json['code']);
	if (code != null) {
		loyaltyCard.code = code;
	}
	final int? id = jsonConvert.convert<int>(json['id']);
	if (id != null) {
		loyaltyCard.id = id;
	}
	final List<String>? currencyId = jsonConvert.convertListNotNull<String>(json['currency_id']);
	if (currencyId != null) {
		loyaltyCard.currencyId = currencyId;
	}
	return loyaltyCard;
}

Map<String, dynamic> $LoyaltyCardToJson(LoyaltyCard entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['points'] = entity.points;
	data['point_name'] = entity.pointName;
	data['points_display'] = entity.pointsDisplay;
	data['program_type'] = entity.programType;
	data['partner_id'] =  entity.partnerId;
	data['expiration_date'] = entity.expirationDate;
	data['code'] = entity.code;
	data['id'] = entity.id;
	data['currency_id'] =  entity.currencyId;
	return data;
}